"use strict";
/*
    函数的参数可以是任何类型
    常用的类型如下：
    1、基础类型
    2、数组类型
    3、对象类型
    4、默认值
    5、可选参数
    6、不定参数
*/
function printStr(ary) {
    return ary.join("、");
}
let result = printStr(["apple", "orange", "banana"]);
console.log(result);
console.log('______________________________');
function printPersonInfo(person) {
    return `我叫${person.name},我今年${person.age},我的爱好是${person.hobby.join("、")}`;
}
let p1 = {
    name: 'Giles',
    age: 38,
    hobby: ['singsong', 'dance', 'write program', 'flush wan']
};
let r3 = printPersonInfo(p1);
console.log(r3);
console.log('*****************************');
function show(name, age = 18) {
    return `我叫${name},今年${age}`;
}
console.log(show("Giles", 38));
console.log(show("zhaijizhe"));
console.log('**************************');
function showInfo(name, sex) {
    let sexInfo = sex ? '我是个' + sex + "的" : '';
    return `我叫${name} ${sexInfo}`;
}
let r4 = showInfo("Giles", "男");
console.log(r4);
let r5 = showInfo("花花");
console.log(r5);
console.log("*******************");
function printNumber(a, ...b) {
    let ary = [a, ...b];
    ary.forEach(item => {
        console.log(item);
    });
}
printNumber(1, 5, 6, 7, 8, 11);
